"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = function (report) {
  var output = "";

  report.forEach(function (sourceReport) {
    if (!sourceReport.ranges || sourceReport.ranges.length === 0) {
      return;
    }
    output += "\n";
    output += _chalk2.default.underline(logFrom(sourceReport.source)) + "\n";
    sourceReport.ranges.forEach(function (range) {
      output += "start: " + range.start;
      if (range.end !== undefined) {
        output += ", end: " + range.end;
      }
      output += "\n";
    });
  });

  return output;
};

var _chalk = require("chalk");

var _chalk2 = _interopRequireDefault(_chalk);

var _path = require("path");

var _path2 = _interopRequireDefault(_path);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function logFrom(fromValue) {
  if (fromValue.charAt(0) === "<") return fromValue;
  return _path2.default.relative(process.cwd(), fromValue).split(_path2.default.sep).join("/");
}